<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
	<script>
		 //存放图片路径的数组
    var imgSrcArr = [
        'http://pic41.nipic.com/20140502/1121943_100923665000_2.jpg',
        'http://pic41.nipic.com/20140502/1121943_100923665000_2.jpg',
        'http://pic41.nipic.com/20140502/1121943_100923665000_2.jpg',
        'http://pic41.nipic.com/20140502/1121943_100923665000_2.jpg'
    ];

    var imgWrap = [];

    function preloadImg(arr) {
        for(var i =0; i< arr.length ;i++) {
            imgWrap[i] = new Image();
            imgWrap[i].src = arr[i];
        }
    }

    preloadImg(imgSrcArr);

    //或者延迟的文档加载完毕在加载图片

    $(function () {
        preloadImg(imgSrcArr);
    })
		
	</script>
	</head>
	<body>
		<img  src=`${imgWrap[1]}`/>
	</body>
</html>
